package frmsystem.gui;

import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SpringLayout;

public class PersonalRegistrationGUI extends RegistrationUI {
	
	private JTextField txtDOB;
	private JButton cmdOk;
	private JButton cmdCancel;
	
	public PersonalRegistrationGUI(){
		JLabel lbldob = new JLabel("Date of Birth");
    	getContentPane().add(lbldob);
    	layout.putConstraint(SpringLayout.WEST, lbldob, 10, SpringLayout.WEST, getContentPane());
        layout.putConstraint(SpringLayout.NORTH, lbldob, 10, SpringLayout.SOUTH, txtEmail);
        
        txtDOB = new JTextField(10);
        getContentPane().add(txtDOB);
        layout.putConstraint(SpringLayout.WEST, txtDOB, 0, SpringLayout.WEST, txtName);
        layout.putConstraint(SpringLayout.NORTH, txtDOB, 0, SpringLayout.NORTH, lbldob);
        
        cmdOk = new JButton("Ok");
        getContentPane().add(cmdOk);
        layout.putConstraint(SpringLayout.WEST, cmdOk, 30, SpringLayout.WEST, getContentPane());
        layout.putConstraint(SpringLayout.NORTH, cmdOk, 20, SpringLayout.SOUTH, lbldob);
        
        cmdCancel = new JButton("Cancel");
        getContentPane().add(cmdCancel);
        layout.putConstraint(SpringLayout.WEST, cmdCancel, 20, SpringLayout.EAST, cmdOk);
        layout.putConstraint(SpringLayout.NORTH, cmdCancel, 0, SpringLayout.NORTH, cmdOk);
        
        setSize(250, 400);
        setModal(true);
	}
	
	public void addOkActionListener(ActionListener al){
		cmdOk.addActionListener(al);
	}
	
	public void addCancelActionListener(ActionListener al){
		cmdCancel.addActionListener(al);
	}

	public JTextField getTxtDOB() {
		return txtDOB;
	}

}
